package com.chenjj.scala.traits

/**
  * Trait用法：选择性混入
  */
object Main1 {

  def main(args: Array[String]): Unit = {

    def userFriend(friend: Friend): Unit ={
      friend.listen()
    }

    val cat = new Cat("cat123")  with  Friend

    userFriend(cat)

  }
}
